package request

type CreateBook struct {
	BookName string `form:"book_name" json:"book_name" binding:"required"`
}

// 自定义错误信息
func (cb CreateBook) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"book_name.required": "书籍名称不能为空",
	}
}

type QueryBook struct {
	Keyword string `form:"keyword" json:"keyword" binding:"required"`
}

func (qb QueryBook) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"keyword.required": "关键字不能为空",
	}
}

type GetBook struct {
	BookId string `form:"book_id" json:"book_id" binding:"required"`
}

func (qb GetBook) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"book_id.required": "书籍id不能为空",
	}
}
